<?php namespace Phpcmf\Controllers\Member;

/**
 * 二次开发时不可以修改本文件，影响升级覆盖
 */

class Shenqing extends \Phpcmf\Member\Module
{

    public function index() {
		$data_list_0 = \Phpcmf\Service::M()->table('1_quan_verify')->where('uid', $this->uid)->getAll();
        //循环
        $data_list_0 = $data_list_0 ?: [];
        foreach($data_list_0 as $key => $val){
            
            $data_list_0[$key]['content'] = dr_string2array($val['content']);
            // 修复字符串偏移访问错误：先确保content是数组格式
            $content_data = is_string($val['content']) ? json_decode($val['content'], true) : $val['content'];
            $content_data = is_array($content_data) ? $content_data : [];
            $data_list_0[$key]['content']['inputtime'] = date('Y-m-d H:i', $content_data['inputtime'] ?? time());
        }
        $tongji = \Phpcmf\Service::M()->db->table('1_quan_verify')->where('uid', $this->uid)->countAllResults();
        $list_data[] = [
			'list' => $data_list_0,
            'tongji' => $tongji,
        ];
        $this->_json('1', '读取成功', $list_data);
        
    }
}
